package cn.airia.as3wplib.service
{
	public interface IMetaWeblogService
	{
		/**
		 *@param blog_id 
		 *@param username 
		 *@param password 
		 *@param content 
		 * <ul>
		 * <li>string post_type (page,post)</li>
		 * <li>string wp_page_template </li>
		 * <li>string wp_slug </li>
		 * <li>string wp_password </li>
		 * <li>int wp_page_parent_id </li>
		 * <li>int wp_page_order</li>
		 * <li>int wp_author_id </li>
		 * <li>string title </li>
		 * <li>string description(if post_type equal 'post',this field means 'content') </li>
		 * <li>string post_status(draft,private,publish,pending) </li>
		 * <li>string mt_excerpt</li>
		 * <li>string mt_text_more </li>
		 * <li>string mt_keywords </li>
		 * <li>string mt_allow_comments(closed,open) </li>
		 * <li>string mt_allow_pings(closed,open) </li>
		 * <li>string mt_tb_ping_urls </li>
		 * <li>date date_created_gmt </li>
		 * <li>date dateCreated </li>
		 * <li>array categories (categories' name) </li>
		 * <li>bool sticky </li>
		 * <li>array custom_fields(elementType Object[id:"",key:"",value:""])</li>
		 * <li>object enclosure (url:"",length:"",type:"")</li>
		 * </ul>
		 *@param publish 
		 *@param retFun int(post_id/page_id) 
		 */
		function newPost(blog_id:int,username:String,password:String,content:Object,publish:Boolean,retFun:Function):void;
		
		/**
		 *@param post_id 
		 *@param username 
		 *@param password 
		 *@param content 
		 * <ul>
		 * <li>string post_type (page,post)</li>
		 * <li>string wp_page_template </li>
		 * <li>string wp_slug </li>
		 * <li>string wp_password </li>
		 * <li>int wp_page_parent_id </li>
		 * <li>int wp_page_order</li>
		 * <li>int wp_author_id </li>
		 * <li>string title </li>
		 * <li>string description(if post_type equal 'post',this field means 'content') </li>
		 * <li>string post_status(draft,private,publish,pending) </li>
		 * <li>string mt_excerpt</li>
		 * <li>string mt_text_more </li>
		 * <li>string mt_keywords </li>
		 * <li>string mt_allow_comments(closed,open) </li>
		 * <li>string mt_allow_pings(closed,open) </li>
		 * <li>string mt_tb_ping_urls </li>
		 * <li>date date_created_gmt </li>
		 * <li>date dateCreated </li>
		 * <li>array categories (categories' name) </li>
		 * <li>bool sticky </li>
		 * <li>array custom_fields(elementType Object[id:"",key:"",value:""])</li>
		 * <li>object enclosure (url:"",length:"",type:"")</li>
		 * </ul>
		 *@param publish 
		 *@param retFun Boolean 
		 */
		function editPost(post_id:int,username:String,password:String,content:Object,publish:Boolean,retFun:Function):void;
		
				
		/**
		 *@param post_id 
		 *@param username 
		 *@param password 
		 *@param retFun Object
		 * <ul>
		 * <li>string post_type (page,post)</li>
		 * <li>string wp_page_template </li>
		 * <li>string wp_slug </li>
		 * <li>string wp_password </li>
		 * <li>int wp_page_parent_id </li>
		 * <li>int wp_page_order</li>
		 * <li>int wp_author_id </li>
		 * <li>string title </li>
		 * <li>string description(if post_type equal 'post',this field means 'content') </li>
		 * <li>string post_status(draft,private,publish,pending) </li>
		 * <li>string mt_excerpt</li>
		 * <li>string mt_text_more </li>
		 * <li>string mt_keywords </li>
		 * <li>string mt_allow_comments(closed,open) </li>
		 * <li>string mt_allow_pings(closed,open) </li>
		 * <li>string mt_tb_ping_urls </li>
		 * <li>date date_created_gmt </li>
		 * <li>date dateCreated </li>
		 * <li>array categories (categories' name) </li>
		 * <li>bool sticky </li>
		 * <li>array custom_fields(elementType Object[id:"",key:"",value:""])</li>
		 * <li>object enclosure (url:"",length:"",type:"")</li>
		 * <li>---- below properties are different from "new" and "edit" form-------</li>
		 * <li>string link</li>
		 * <li>string permaLink</li>
		 * <li>string wp_author_display_name</li>
		 * </ul>
		 */
		function getPost(post_id:int,username:String,password:String,retFun:Function):void;	
		/**
		 *@param  blog_id 
		 *@param username 
		 *@param password 
		 *@param num_post 
		 *@param retFun Array ( element's strut is same as getPost()'s return value)
		 *@see cn.airia.as3wplib.service.IMetaWeblogService#getPost() 
		 */
		function getRecentPosts(blog_id:int,username:String,password:String,num_posts:int,retFun:Function):void;
		/**
		 *@param  blog_id 
		 *@param username 
		 *@param password 
		 *@param retFun Array 
		 * element type:Object
		 * 	<ul>
		 * 		<li>string categoryDescription</li>
		 * 		<li>int categoryId</li>
		 * 		<li>string categoryName</li>
		 * 		<li>string description</li>
		 * 		<li>string htmlUrl</li>
		 * 		<li>int parentId</li>
		 * 		<li>string rssUrl</li>
		 * 	</ul>
		 */
		function getCategories(blog_id:int,username:String,password:String,retFun:Function):void;
		/**
		 * haven't tested this operation yet
		 */
		function newMediaObject(blog_id:int,username:String,password:String,data:Object,retFun:Function):void;
		/**
		 *@copy cn.airia.as3wplib.service.IBloggerService#deletePost() 
		 */
		function deletePost(post_id:int,username:String,password:String,publish:Boolean,retFun:Function):void;
		/**
		 *@copy cn.airia.as3wplib.service.IBloggerService#getTemplate() 
		 */
		function getTemplate(blog_id:int,username:String,password:String,template:String,retFun:Function):void;
		/**
		 *@copy cn.airia.as3wplib.service.IBloggerService#setTemplate() 
		 */		
		function setTemplate(blog_id:int,username:String,password:String,template:String,content:Object,retFun:Function):void;
		/**
		 *@copy cn.airia.as3wplib.service.IBloggerService#getUsersBlogs() 
		 */		
		function getUsersBlogs(username:String,password:String,retFun:Function):void;
	}
}